//
//  MIDIddxqController.m
//  迷笛
//
//  Created by . on 2018/9/11.
//  Copyright © 2018年 🍃🌺🌺🍃. All rights reserved.
//

#import "MIDIddxqController.h"
#import "MIDIddxqCell.h"
@interface MIDIddxqController ()<UITableViewDelegate,UITableViewDataSource>
@property(nonatomic,strong)UITableView * Myddxqtable;

@end

@implementation MIDIddxqController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIBarButtonItem *leftBarItem = [[UIBarButtonItem alloc] initWithTitle:nil style:UIBarButtonItemStylePlain target:self action:@selector(Block:)];
    self.navigationItem.leftBarButtonItem = leftBarItem;
    
    [self.navigationItem.leftBarButtonItem setImage:[[UIImage imageNamed:@"后退"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    [self HomeUI];

}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;
{
    return 2;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
{
    static NSString * cellID = @"cell";
    MIDIddxqCell * cell =[tableView dequeueReusableCellWithIdentifier:cellID];
    if (!cell)
    {
        cell =[[MIDIddxqCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellID];
        cell.backgroundColor =[UIColor colorWithHexString:@"#1B212F"];
        [_Myddxqtable setSeparatorColor : [UIColor blackColor]];
        cell.selectionStyle=UITableViewCellSelectionStyleNone;

    }
    if (indexPath.row == 0)
    {
        cell.mainiamge.image = [UIImage imageNamed:@"IMG_0195.jpg"];
        cell.maintext.text = @"北部湾（钦州）迷笛音乐节";
        cell.address.text =@"场次：2018-09-03  12:00";
        cell.time.text = @"地点：北京市朝阳区朝阳公园325号创...";
        cell.rmb.text = @"1张";
        cell.price.text = @"750元";
    }
    if (indexPath.row ==1)
    {
        cell.payment.text = @"付款总额";
        cell.goods.text = @"商品金额";

        cell.number.text = @"订单编号：1040569996";
        cell.gmtime.text = @"购买时间：2017-07-02 15:36:35";
        cell.iphone.text = @"联系手机：136****5566";
        cell.state.text =@"订单状态：订单完成";
        cell.cash.text = @"100";
        cell.cash2.text = @"100元";
    }
    return cell;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 185;
}
- ( UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section;
{
    return nil;
}
- ( UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section;
{
    return nil;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 1;
}
// 返回上一级
-(void)Block:(UIButton * )sender
{
    [self.navigationController popViewControllerAnimated:YES];

}
- (void)viewWillAppear:(BOOL)animated
{
    self.navigationController.navigationBar.barTintColor = [UIColor colorWithHexString:@"#171717"];
    self.navigationController.navigationBar.translucent = NO;//Bar的模糊效果，默认为YES

    self.title = @"订单详情";
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#FFFFFF"]}];
    //    去掉导航黑线
    UIImage *img = [UIImage imageNamed:@""];
    [self.navigationController.navigationBar setBackgroundImage:img  forBarMetrics:UIBarMetricsDefault];
    self.navigationController.navigationBar.shadowImage = [[UIImage alloc] init];
}
-(void)HomeUI
{
    [self.view addSubview:self.Myindenttable];
}
-(UITableView *)Myindenttable
{
    if (!_Myddxqtable)
    {
        _Myddxqtable = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height - 40) style:UITableViewStyleGrouped];
        _Myddxqtable.dataSource = self;
        _Myddxqtable.delegate = self;
        _Myddxqtable.backgroundColor = [UIColor blackColor];
        //        _Hottable.separatorStyle = UITableViewCellSeparatorStyleNone;
    }
    return _Myddxqtable;
}

@end
